#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :st_init.py
# @Time      :2024/10/22 21:21
# @Author    :zhou_yi

import streamlit as st


# 初始化页面对话
def st_session_init():
    # 三方比价单价
    if "init_signal_price" not in st.session_state:
        st.session_state.init_signal_price = [500.00, 540.00, 620.00]
    # 匹配'有害垃圾', '清运'的正则条件的公司作为甲方
    if "init_partA_condition" not in st.session_state:
        st.session_state.init_partA_conditional = ['有害垃圾', '清运']
    # 匹配'三方比价'正则条件公司作为比价公司
    if "init_three_condition" not in st.session_state:
        st.session_state.init_three_conditional = ["三方比价"]

    # 签名日期初始值，当前日期20天内随机选择
    if 'init_random_days' not in st.session_state:
        st.session_state.init_random_days = 20

    # 合同期的起始日期往前推10天，作为签名日期的起点
    if 'init_current_days' not in st.session_state:
        st.session_state.init_current_days = 10

    # 数据库查找出的 公司的数据
    if 'default_data' not in st.session_state:
        st.session_state.default_data = []

    # 甲方
    if 'partA' not in st.session_state:
        st.session_state.partA = ''

    # 模版文件
    if "tpl_files" not in st.session_state:
        st.session_state.tpl_files = {}

    # 当前选择的模版文件
    if 'current_tpl' not in st.session_state:
        st.session_state.current_tpl = ''

    if 'start_date' not in st.session_state:
        st.session_state.start_date = None

    if 'end_date' not in st.session_state:
        st.session_state.end_date = None

    # 服务期
    if 'date' not in st.session_state:
        st.session_state.date = ''

    if 'months' not in st.session_state:
        st.session_state.months = 1

    # 数据库拿到的公司列表
    if 'three_price_company' not in st.session_state:
        st.session_state.three_price_company = []

    # 缓存选择的公司
    if 'three_price_form_catch' not in st.session_state:
        st.session_state.three_price_form_catch = []

    # 生成word文件所需数据
    if 'context' not in st.session_state:
        st.session_state.context = {}

    "-----------------------------------------------"
    # 合同甲方
    if 'contract_partA' not in st.session_state:
        st.session_state.contract_partA = []
    # 当前甲方
    if 'current_contract_partA' not in st.session_state:
        st.session_state.current_contract_partA = ''

    # 合同乙方
    if 'contract_partB' not in st.session_state:
        st.session_state.contract_partB = []

    # 当前乙方
    if 'current_contract_partB' not in st.session_state:
        st.session_state.current_contract_partB = ''

    # 合同模版文件
    if 'contract_tpl_files' not in st.session_state:
        st.session_state.contract_tpl_files = {}

    # 当前合同模版文件
    if 'contract_current_tpl' not in st.session_state:
        st.session_state.contract_current_tpl = ''

    # 生成合同文件所需数据
    if 'contract_context' not in st.session_state:
        st.session_state.contract_context = {}
    # 合同名称
    if 'contract_title' not in st.session_state:
        st.session_state.contract_title = ''

    "================================================================"
    # 存放输入的点位信息
    if 'input_points_info' not in st.session_state:
        st.session_state.points_info = []
    # 当前输入的点位信息
    if 'current_point_info_input' not in st.session_state:
        st.session_state.current_point_info_input = {}

    if 'pointRecs' not in st.session_state:
        st.session_state.pointRecs = None
    if 'current_clear_record_input' not in st.session_state:
        st.session_state.current_clear_record_input = {}

    if 'rnd_clear_records' not in st.session_state:
        st.session_state.rnd_clear_records = {}

    if 'really_clear_records' not in st.session_state:
        st.session_state.really_clear_records = {}


if __name__ == '__main__':
    ...
